Component({
  options: {
    addGlobalClass: true,
  },
  /**
   * 组件的属性列表
   */
  properties: {
    // 开学时间
    startDate: {
      type: String,
      value: ''
    },
    // 节数设置
    sectionIndex: {
      type: Array,
      value: ''
    },
    // 课表提醒
    remind: {
      type: Boolean,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    showTips: false,
    sectionArray: [
      [1, 2, 3, 4, 5, 6, 7, 8, 9],
      [1, 2, 3, 4, 5, 6, 7, 8, 9],
      [1, 2, 3, 4, 5, 6, 7, 8, 9]
    ],
  },
  lifetimes: {
    attached: function () {
    },
  },
  methods: {
    // 开学时间
    async dateChange(e) {
      this.triggerEvent('DateChange', e.detail.value);
    },

    // 节数设置
    sectionChange(e) {
      this.triggerEvent('SectionChange', e.detail.value);
      wx.setStorageSync('sectionIndex', e.detail.value);
    },

    // 课表提醒
    async remind(e) {
      this.setData({ showTips: e.detail.value == true ? true : false });
      this.triggerEvent('Remind', e.detail.value);
    }
  }
})